package com.melesta.payment;

import com.melesta.engine.Log;
import java.text.Format;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;

public class PaymentTransaction
{
  private static final int serialVersionUID = 1;
  public long consumeTime = -1L;
  public String customData;
  public long internalId = -1L;
  public String paymentId;
  public String paymentSystem;
  public long processingTime = -1L;
  public int quantity = -1;
  public long time = -1L;

  public static String convertTime(long paramLong)
  {
    try
    {
      Date localDate = new Date(paramLong);
      String str = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss", Locale.getDefault()).format(localDate).toString();
      return str;
    }
    catch (Exception localException)
    {
    }
    return "invalid-" + paramLong;
  }

  // ERROR //
  public static PaymentTransaction deserialize(byte[] paramArrayOfByte)
  {
    // Byte code:
    //   0: new 2	com/melesta/payment/PaymentTransaction
    //   3: dup
    //   4: invokespecial 85	com/melesta/payment/PaymentTransaction:<init>	()V
    //   7: astore_1
    //   8: new 87	java/io/ByteArrayInputStream
    //   11: dup
    //   12: aload_0
    //   13: invokespecial 90	java/io/ByteArrayInputStream:<init>	([B)V
    //   16: astore_2
    //   17: new 92	java/io/DataInputStream
    //   20: dup
    //   21: aload_2
    //   22: invokespecial 95	java/io/DataInputStream:<init>	(Ljava/io/InputStream;)V
    //   25: astore_3
    //   26: aload_3
    //   27: invokevirtual 99	java/io/DataInputStream:readInt	()I
    //   30: pop
    //   31: aload_1
    //   32: aload_3
    //   33: invokevirtual 102	java/io/DataInputStream:readUTF	()Ljava/lang/String;
    //   36: putfield 104	com/melesta/payment/PaymentTransaction:paymentId	Ljava/lang/String;
    //   39: aload_1
    //   40: aload_3
    //   41: invokevirtual 102	java/io/DataInputStream:readUTF	()Ljava/lang/String;
    //   44: putfield 106	com/melesta/payment/PaymentTransaction:paymentSystem	Ljava/lang/String;
    //   47: aload_1
    //   48: aload_3
    //   49: invokevirtual 99	java/io/DataInputStream:readInt	()I
    //   52: putfield 23	com/melesta/payment/PaymentTransaction:quantity	I
    //   55: aload_1
    //   56: aload_3
    //   57: invokevirtual 110	java/io/DataInputStream:readLong	()J
    //   60: putfield 27	com/melesta/payment/PaymentTransaction:time	J
    //   63: aload_1
    //   64: aload_3
    //   65: invokevirtual 110	java/io/DataInputStream:readLong	()J
    //   68: putfield 29	com/melesta/payment/PaymentTransaction:processingTime	J
    //   71: aload_1
    //   72: aload_3
    //   73: invokevirtual 110	java/io/DataInputStream:readLong	()J
    //   76: putfield 31	com/melesta/payment/PaymentTransaction:consumeTime	J
    //   79: aload_1
    //   80: aload_3
    //   81: invokevirtual 110	java/io/DataInputStream:readLong	()J
    //   84: putfield 33	com/melesta/payment/PaymentTransaction:internalId	J
    //   87: aload_1
    //   88: aload_3
    //   89: invokevirtual 102	java/io/DataInputStream:readUTF	()Ljava/lang/String;
    //   92: putfield 112	com/melesta/payment/PaymentTransaction:customData	Ljava/lang/String;
    //   95: aload_3
    //   96: invokevirtual 115	java/io/DataInputStream:close	()V
    //   99: aload_2
    //   100: invokevirtual 116	java/io/ByteArrayInputStream:close	()V
    //   103: aload_1
    //   104: getfield 23	com/melesta/payment/PaymentTransaction:quantity	I
    //   107: iconst_m1
    //   108: if_icmpne +5 -> 113
    //   111: aconst_null
    //   112: astore_1
    //   113: aload_1
    //   114: areturn
    //   115: astore 6
    //   117: aload 6
    //   119: invokestatic 122	com/melesta/engine/Error:processException	(Ljava/lang/Exception;)V
    //   122: aload_3
    //   123: invokevirtual 115	java/io/DataInputStream:close	()V
    //   126: aload_2
    //   127: invokevirtual 116	java/io/ByteArrayInputStream:close	()V
    //   130: goto -27 -> 103
    //   133: astore 7
    //   135: goto -32 -> 103
    //   138: astore 4
    //   140: aload_3
    //   141: invokevirtual 115	java/io/DataInputStream:close	()V
    //   144: aload_2
    //   145: invokevirtual 116	java/io/ByteArrayInputStream:close	()V
    //   148: aload 4
    //   150: athrow
    //   151: astore 5
    //   153: goto -5 -> 148
    //   156: astore 9
    //   158: goto -55 -> 103
    //
    // Exception table:
    //   from	to	target	type
    //   26	95	115	java/io/IOException
    //   122	130	133	java/io/IOException
    //   26	95	138	finally
    //   117	122	138	finally
    //   140	148	151	java/io/IOException
    //   95	103	156	java/io/IOException
  }

  public static void dump(PaymentTransaction paramPaymentTransaction)
  {
    StringBuilder localStringBuilder = new StringBuilder(128);
    dump(paramPaymentTransaction, localStringBuilder);
    Log.d("engine", localStringBuilder.toString());
  }

  public static void dump(PaymentTransaction paramPaymentTransaction, StringBuilder paramStringBuilder)
  {
    paramStringBuilder.append("iId: ").append(paramPaymentTransaction.internalId);
    paramStringBuilder.append("   id: ").append(paramPaymentTransaction.paymentId);
    paramStringBuilder.append("   sys: ").append(paramPaymentTransaction.paymentSystem);
    paramStringBuilder.append("   time: ").append(convertTime(paramPaymentTransaction.time));
    paramStringBuilder.append("   pTime: ").append(convertTime(paramPaymentTransaction.processingTime));
    paramStringBuilder.append("   cTime: ").append(convertTime(paramPaymentTransaction.consumeTime));
    paramStringBuilder.append("   udata: ").append(paramPaymentTransaction.customData);
  }

  public static void dump(List<PaymentTransaction> paramList)
  {
    Iterator localIterator = paramList.iterator();
    while (localIterator.hasNext())
      dump((PaymentTransaction)localIterator.next());
  }

  public static void dump(List<PaymentTransaction> paramList, StringBuilder paramStringBuilder)
  {
    Iterator localIterator = paramList.iterator();
    while (localIterator.hasNext())
      dump((PaymentTransaction)localIterator.next(), paramStringBuilder);
  }

  public static PaymentTransaction isInList(List<PaymentTransaction> paramList, String paramString)
  {
    Iterator localIterator = paramList.iterator();
    while (localIterator.hasNext())
    {
      PaymentTransaction localPaymentTransaction = (PaymentTransaction)localIterator.next();
      if (localPaymentTransaction.paymentId.equals(paramString))
        return localPaymentTransaction;
    }
    return null;
  }

  // ERROR //
  public byte[] serialize()
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 104	com/melesta/payment/PaymentTransaction:paymentId	Ljava/lang/String;
    //   4: ifnonnull +9 -> 13
    //   7: aload_0
    //   8: ldc 184
    //   10: putfield 104	com/melesta/payment/PaymentTransaction:paymentId	Ljava/lang/String;
    //   13: aload_0
    //   14: getfield 112	com/melesta/payment/PaymentTransaction:customData	Ljava/lang/String;
    //   17: ifnonnull +9 -> 26
    //   20: aload_0
    //   21: ldc 184
    //   23: putfield 112	com/melesta/payment/PaymentTransaction:customData	Ljava/lang/String;
    //   26: new 186	java/io/ByteArrayOutputStream
    //   29: dup
    //   30: bipush 32
    //   32: iconst_4
    //   33: bipush 8
    //   35: bipush 8
    //   37: iconst_4
    //   38: iconst_4
    //   39: aload_0
    //   40: getfield 104	com/melesta/payment/PaymentTransaction:paymentId	Ljava/lang/String;
    //   43: invokevirtual 189	java/lang/String:length	()I
    //   46: iadd
    //   47: iadd
    //   48: iadd
    //   49: iadd
    //   50: iadd
    //   51: aload_0
    //   52: getfield 112	com/melesta/payment/PaymentTransaction:customData	Ljava/lang/String;
    //   55: invokevirtual 189	java/lang/String:length	()I
    //   58: iadd
    //   59: iadd
    //   60: invokespecial 190	java/io/ByteArrayOutputStream:<init>	(I)V
    //   63: astore_1
    //   64: new 192	java/io/DataOutputStream
    //   67: dup
    //   68: aload_1
    //   69: invokespecial 195	java/io/DataOutputStream:<init>	(Ljava/io/OutputStream;)V
    //   72: astore_2
    //   73: aload_2
    //   74: iconst_1
    //   75: invokevirtual 198	java/io/DataOutputStream:writeInt	(I)V
    //   78: aload_2
    //   79: aload_0
    //   80: getfield 104	com/melesta/payment/PaymentTransaction:paymentId	Ljava/lang/String;
    //   83: invokevirtual 202	java/io/DataOutputStream:writeUTF	(Ljava/lang/String;)V
    //   86: aload_2
    //   87: aload_0
    //   88: getfield 106	com/melesta/payment/PaymentTransaction:paymentSystem	Ljava/lang/String;
    //   91: invokevirtual 202	java/io/DataOutputStream:writeUTF	(Ljava/lang/String;)V
    //   94: aload_2
    //   95: aload_0
    //   96: getfield 23	com/melesta/payment/PaymentTransaction:quantity	I
    //   99: invokevirtual 198	java/io/DataOutputStream:writeInt	(I)V
    //   102: aload_2
    //   103: aload_0
    //   104: getfield 27	com/melesta/payment/PaymentTransaction:time	J
    //   107: invokevirtual 205	java/io/DataOutputStream:writeLong	(J)V
    //   110: aload_2
    //   111: aload_0
    //   112: getfield 29	com/melesta/payment/PaymentTransaction:processingTime	J
    //   115: invokevirtual 205	java/io/DataOutputStream:writeLong	(J)V
    //   118: aload_2
    //   119: aload_0
    //   120: getfield 31	com/melesta/payment/PaymentTransaction:consumeTime	J
    //   123: invokevirtual 205	java/io/DataOutputStream:writeLong	(J)V
    //   126: aload_2
    //   127: aload_0
    //   128: getfield 33	com/melesta/payment/PaymentTransaction:internalId	J
    //   131: invokevirtual 205	java/io/DataOutputStream:writeLong	(J)V
    //   134: aload_2
    //   135: aload_0
    //   136: getfield 112	com/melesta/payment/PaymentTransaction:customData	Ljava/lang/String;
    //   139: invokevirtual 202	java/io/DataOutputStream:writeUTF	(Ljava/lang/String;)V
    //   142: aload_1
    //   143: invokevirtual 208	java/io/ByteArrayOutputStream:toByteArray	()[B
    //   146: astore 7
    //   148: aload_2
    //   149: invokevirtual 209	java/io/DataOutputStream:close	()V
    //   152: aload_1
    //   153: invokevirtual 210	java/io/ByteArrayOutputStream:close	()V
    //   156: aload 7
    //   158: areturn
    //   159: astore 5
    //   161: aload 5
    //   163: invokestatic 122	com/melesta/engine/Error:processException	(Ljava/lang/Exception;)V
    //   166: aload_2
    //   167: invokevirtual 209	java/io/DataOutputStream:close	()V
    //   170: aload_1
    //   171: invokevirtual 210	java/io/ByteArrayOutputStream:close	()V
    //   174: aconst_null
    //   175: areturn
    //   176: astore_3
    //   177: aload_2
    //   178: invokevirtual 209	java/io/DataOutputStream:close	()V
    //   181: aload_1
    //   182: invokevirtual 210	java/io/ByteArrayOutputStream:close	()V
    //   185: aload_3
    //   186: athrow
    //   187: astore 4
    //   189: goto -4 -> 185
    //   192: astore 6
    //   194: goto -20 -> 174
    //   197: astore 8
    //   199: aload 7
    //   201: areturn
    //
    // Exception table:
    //   from	to	target	type
    //   73	148	159	java/io/IOException
    //   73	148	176	finally
    //   161	166	176	finally
    //   177	185	187	java/io/IOException
    //   166	174	192	java/io/IOException
    //   148	156	197	java/io/IOException
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.melesta.payment.PaymentTransaction
 * JD-Core Version:    0.6.2
 */